package com.bainaeco.framework.enums;

import com.bainaeco.framework.exception.InvalidArgumentException;

public enum KeyStrategy {
	
	UUID("uuid");
	
	private String strategy;

	private KeyStrategy(String strategy) {
		this.strategy = strategy;
	}

	public String toStringValue() {
		return this.strategy;
	}

	public static KeyStrategy toStatus(String strategy) {
		if (UUID.strategy.equals(strategy)) {
			return UUID;
		} else {
			throw new InvalidArgumentException("Unknown strategy[" + strategy + "].");
		}
	}
}
